package com.blues.cedar.model;

import javax.persistence.*;
/** 
 * 对象属性
 */

@Entity
@Table( name = "cd_property" )
public class Property {
	private long entityId;
	private String name;
	private String caption;
	private String column;
	private int length;
	private int precision;
	private int scale;
	private boolean notNull;
	private boolean unique;
	private String index;
	private String uniqueKey;
	private String foreignKey;
	private String sqlType;
	private String defaultValue;
	private String check;
	
	@Id
	@Column(name = "entity_id")
	public long getEntityId() {
		return this.entityId;
	}
	public void setEntityId(long entityId) {
		this.entityId = entityId;
	}
	
	@Column
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column
	public String getCaption() {
		return this.caption;
	}
	public void setCaption(String caption) {
		this.caption = caption;
	}
	
	@Column
	public String getColumn() {
		return this.column;
	}
	public void setColumn(String column) {
		this.column = column;
	}
	
	@Column
	public int getLength() {
		return this.length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	
	@Column
	public int getPrecision() {
		return this.precision;
	}
	public void setPrecision(int precision) {
		this.precision = precision;
	}
	
	@Column
	public int getScale() {
		return this.scale;
	}
	public void setScale(int scale) {
		this.scale = scale;
	}
	
	@Column(name = "not_null")
	public boolean isNotNull() {
		return this.notNull;
	}
	public void setNotNull(boolean notNull) {
		this.notNull = notNull;
	}

	@Column
	public boolean isUnique() {
		return this.unique;
	}
	public void setUnique(boolean unique) {
		this.unique = unique;
	}
	
	@Column
	public String getIndex() {
		return this.index;
	}
	public void setIndex(String index) {
		this.index = index;
	}
	
	@Column(name = "unique_key")
	public String getUniqueKey() {
		return this.uniqueKey;
	}
	public void setUniqueKey(String uniqueKey) {
		this.uniqueKey = uniqueKey;
	}
	
	@Column(name = "foreign_key")
	public String getForeignKey() {
		return this.foreignKey;
	}
	public void setForeignKey(String foreignKey) {
		this.foreignKey = foreignKey;
	}
	
	@Column(name = "sql_type")
	public String getSqlType() {
		return this.sqlType;
	}
	public void setSqlType(String sqlType) {
		this.sqlType = sqlType;
	}
	
	@Column(name = "default_value")
	public String getDefaultValue() {
		return this.defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	
	@Column
	public String getCheck() {
		return this.check;
	}
	public void setCheck(String check) {
		this.check = check;
	}
	
	public String toString() {
		return "Property{entityId: " + entityId + 
				", name: " + name + 
				", caption: " + caption +
				", column: " + column + 
				", sqlType: " + sqlType + "}";
	}
}
